package com.wellinast.spring_ai.config;

import org.springframework.ai.tool.annotation.Tool;
import org.springframework.ai.tool.annotation.ToolParam;

import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author chenfeng
 * @version 1.0
 * @description: TODO
 * @date 2025/8/5 14:05
 */
public class SystemTools {

    @Tool(description = "获取当前的日期")
    public String getTimeByZoneId(@ToolParam(description = "时区 id, 默认为 Asia/Shanghai")
                                  String zoneId) {
        ZoneId zid = ZoneId.of(zoneId);
        ZonedDateTime zonedDateTime = ZonedDateTime.now(zid);
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        return zonedDateTime.format(formatter);

    }
}
